<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let stu = [{
        name: "xiaoming",
        age: 18,
        gender: "male",
        hometowm: "guangdong"
      },
      {
        name: "xiaohong",
        age: 18,
        gender: "female",
        hometowm: "guangdong"
      },
      {
        name: "xiaomgang",
        age: 19,
        gender: "male",
        hometowm: "guangdong"
      },
      {
        name: "xiaomi",
        age: 17,
        gender: "female",
        hometowm: "guangdong"
      },
    ]

    // for (let i = 0; i < stu.length; i++) {
    //   console.log(stu[i].name);
    //   console.log(stu[i].age);
    //   console.log(stu[i].gender);
    //   console.log(stu[i].hometowm);
    // }

    for (let i in stu) {
      console.log(stu[i]);
      for (let key in stu[i]) {
        // console.log(key);
        console.log(stu[i][key]);

      }
    }

    // for (let i in stu) {
    //   let entries = Object.entries(stu[i]);
    //   entries.forEach(([key, value]) => {
    //     console.log(value);
    //     console.log(key + ":" + value);
    //   });
    // }
  </script>
</body>

</html>